package com.olah.common.utils;

import io.github.yedaxia.apidocs.Docs;
import io.github.yedaxia.apidocs.DocsConfig;

public class ApiGenerate {

    public static void generate() {

        String basedir = "C:\\Users\\cinco\\OneDrive\\programs\\projects\\Coding\\olah";
        String projectName = "springcloud";
        String projectdir = basedir + "\\" + projectName;

        DocsConfig config = new DocsConfig();
        config.setProjectPath(projectdir); // root project path
        config.setProjectName(projectName); // project name
        config.setApiVersion("V1.0");       // api version
        config.setDocsPath(projectdir + "\\api"); // api docs target path
        config.setAutoGenerate(Boolean.TRUE);  // auto generate
        Docs.buildHtmlDocs(config); // execute to generate
    }

}
